In coding theory, the Lee distance is a distance between two strings and of equal length n over the q-ary alphabet {0, 1, …, q − 1} of size q ≥ 2. It is a metric, defined as
If q = 2 or q = 3 the Lee distance coincides with the Hamming distance.
The metric space induced by the Lee distance is a discrete analog of the elliptic space.
If q = 6, then the Lee distance between 3340 and 2543 is 1 + 2 + 0 + 3 = 6.
The Lee distance is named after C. Y. Lee. It is applied for phase modulation while the Hamming distance is used in case of orthogonal modulation.